package com.itheima.chapter07.time;

import java.util.Date;

public class date {
    public static void main(String[] args) {
        //构造方法
        Date date =new Date();
        System.out.println(date);
        //Mon Nov 25 17:16:56 CST 2024当前时间
        Date date1 = new Date(0L);
        System.out.println(date1);
        //Thu Jan 01 08:00:00 CST 1970时间原点开始过指定毫秒后的时间

        //成员方法
        //获取时间毫秒值
        long time = date.getTime();
        System.out.println(time);//1732526484244
        long l = System.currentTimeMillis();
        System.out.println(l);//1732526484244
        //设置时间
        date.setTime(0L);
        System.out.println(date);
        //Thu Jan 01 08:00:00 CST 1970

    }
}
